package co.fitstart.weapp.api.service;

import java.util.Date;
import java.util.List;

import co.fitstart.entity.user.Student;
import co.fitstart.entity.user.User;
import co.fitstart.entity.user.inbody.InbodyRecord;

/**
 * 
 * @author dan
 *
 */
public interface UserService {
    
    /**
     * 
     * @param unionid
     * @return
     */
    public User load(String unionid);
    
    /**
     * 
     * @param userId
     * @return
     */
    public User load(Long userId);
    
    /**
     * 
     * @param mobile
     * @return
     */
    public User loadByMobile(String mobile);
    
    /**
     * 
     * @param country
     * @param prd
     * @param user
     */
    public void editRegion(String country, String prd, User user);
    
    /**
     * 
     * @param name
     * @param mobile
     * @param region
     * @param address
     * @param user
     */
    public void editAddress(String name, String mobile, String region, String address, User user);
    
    /**
     * 
     * @param user
     * @return
     */
    public Date latestEffectiveDate(User user);
    
    /**
     * 
     * @param user
     * @return
     */
    public InbodyRecord getLatestInbodyRecord(User user);
    
    /**
     * 
     * @param user
     * @return
     */
    public List<InbodyRecord> listInbodyRecord(User user);
    
    /**
     * 
     * @param user
     * @return
     */
    public Student getStudent(User user);

    /**
     * 
     * @param mobile
     * @param openid
     * @param unionid
     * @param isEmail
     * @return
     */
    public User login(String mobile, String openid, String unionid, boolean isEmail);

    /**
     * 
     * @param user
     * @param mobile
     */
    public void editMobile(User user, String mobile);

    /**
     * 
     * @param user
     * @param nickname
     * @param avatar
     */
    public void editAvatar(User user, String nickname, String avatar);
}
